package net.pulseproject.commons.util;

public class SetterInvocationException extends RuntimeException {

	private static final long serialVersionUID = -3568388126491708523L;
	
	private final Object host;
	private final String propertyName;
	private final Object propertyValue;
	private final String setterMethodName;
	
	public SetterInvocationException(
			Object host,
			String propertyName,
			Object propertyValue,
			String setterMethodName,
			Throwable cause) {
		super("Could not invoke setter [" + setterMethodName + "] " +
				"for property [" + propertyName + "] " +
				"for host of type [" + host.getClass().getName() + "]!", cause);
		
		this.host = host;
		this.propertyName = propertyName;
		this.propertyValue = propertyValue;
		this.setterMethodName = setterMethodName;
	}

	public final Object getHost() {
		return this.host;
	}

	public final String getPropertyName() {
		return this.propertyName;
	}

	public final Object getPropertyValue() {
		return this.propertyValue;
	}

	public final String getSetterMethodName() {
		return this.setterMethodName;
	}
	
}
